]> permondes.de Git - Analog_Engine.git/blobdiff - scripts/Superposition of oscillations.LACE
Further examples of harmonic oscillation
[Analog_Engine.git] / scripts / Superposition of oscillations.LACE
diff --git a/scripts/Superposition of oscillations.LACE b/scripts/Superposition of oscillations.LACE
new file mode 100644 (file)
index 0000000..b25f7e4
--- /dev/null
@@ -0,0 +1,31 @@
+# Superposition of the oscillation of two undamped harmonic oscillators
+# x1'' = -omega1^2*x1
+# x2'' = -omega2^2*x2
+
+coefficient.1(-1) -> -x10 # amplitude of 1
+coefficient.2     -> omega1^2
+coefficient.5(-1) -> -x20 # amplitude of 2
+coefficient.6     -> omega2^2
+
+# 1st oscillator
+iintegrate x1'' -> -x1'
+iintegrate -x1' -> x1
+  IC: -x10
+cmultiply x1, omega1^2 -> omega1^2*x1
+invert omega1^2*x1 -> -omega1^2*x1
+assign -omega1^2*x1 -> x1''
+output x1 -> out.x
+
+# 2nd oscillator
+iintegrate x2'' -> -x2'
+iintegrate -x2' -> x2
+  IC: -x20
+cmultiply x2, omega2^2 -> omega2^2*x2
+invert omega2^2*x2 -> -omega2^2*x2
+assign -omega2^2*x2 -> x2''
+output x2 -> out.y
+
+# Sum
+isum x1, x2 -> -(x1+x2)
+invert -(x1+x2) -> x1+x2
+output x1+x2 -> out.z